% This function sets parameter values that are not structurally estimated.

function [pr_fc, x_fc, lapse, no_insurer_fe,...
    beta_c, beta_f, T1, T2, B1_c, B2_c, B1_f, B2_f, ...
    crra, rho, sigma_c1, sigma_c2, eulerc, ...
    N_y, pr_y, y_medi, delta, resource_y1, resource_y2]...
    = set_parameters(K, max_p1, max_p2)
%% time horizon
beta_c = 0.97; % consumers
beta_f = 0.97; % firms

T1 = 8;
T2 = 4;

B1_c = (1-beta_c^T1)/(1-beta_c);
B2_c = (1-beta_c^T2)/(1-beta_c);

B1_f = (1-beta_f^T1)/(1-beta_f);
B2_f = (1-beta_f^T2)/(1-beta_f);

%% decide whether to allow lapses in the second period
lapse = 0; % exogenous in the baseline specification

% https://www.soa.org/resources/experience-studies/2016/research-ltc-insurance/
delta = (1-0.97^T2)*ones(1,K);

%% consumers' risk aversion
crra = 1; % to use CARA, set crra=0.
rho  = 1; % either CRRA or CARA coefficient

%% consumers' EV taste shocks
% sigma_c1 for 1st period insurance choice, 
% sigma_c2 for 2nd period lapse choice -> irrelevant when lapse=0
sigma_c1 = 1;
sigma_c2 = 1;

% euler's constant
eulerc = double(eulergamma);

%% consumer heterogeneity based on HRS: stats from HRS_stats.do
%{
gen type=1 if y_gr==1 & d_rhlpfutnb==0
replace type=2 if y_gr==2 & d_rhlpfutnb==0
replace type=3 if y_gr==3 & d_rhlpfutnb==0
replace type=4 if y_gr==1 & d_rhlpfutnb==1
replace type=5 if y_gr==2 & d_rhlpfutnb==1
replace type=6 if y_gr==3 & d_rhlpfutnb==1
%}

% # of consumer types
N_y = 6; % 3 income groups x dummy for access to family care

% consumer type distribution 
pr_y = [17.77; 18.31; 20.45; 11.21; 14.94; 17.32]/100; 

resource_y1 = repmat([10682; 20378; 39469],2,1); 
resource_y2 = resource_y1;

% LTC risk
pr_fc = [0.22; 0.20; 0.17; 0.15; 0.13; 0.11]; 

% scale to ensure lifetime LTC risk is about 40% (Braun et al. 2019)
multiplier = 0.4/sum(pr_y.*pr_fc); 
pr_fc = multiplier*pr_fc;

% cost of formal care in each state (Kemper et al., 2005/2006)
x_fc = (60000/sum(pr_fc.*pr_y))/T2;

%% Medicaid consumption floor 
y_medi = 10000;

%% decide whether to estimate insurer FE
no_insurer_fe = 1; % redundant 


